package cn.hzc.fortess.system.controller;

import cn.hzc.fortess.system.search.LoginLogSearch;
import cn.hzc.fortess.system.service.LogService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

@Api(tags = {"登录日志管理"})
@Controller
@RequestMapping("/sam/loginlog")
public class LoginLogController extends BaseController {

    @Autowired
    private LogService logService;

    @ApiIgnore
    @RequestMapping(value = "",method = RequestMethod.GET)
    public String index() {
        return buildToView( "index.html");
    }

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @ResponseBody
    public Object page(LoginLogSearch search) {
        return this.logService.getLoginLogPage(search);
    }


    @Override
    protected String moduleName() {
        return "loginlog";
    }
}
